package com.itheima.泛型.sort;

import java.util.TreeSet;

/**
 * @Author 王加鑫
 * @Date 2021/5/14 17:16
 * @Version 1.0
 */
public class Demo01 {
    public static void main(String[] args) {
        String s = "90 -1 -1 25 32 32 66";
        String[] strings = s.split(" ");
        TreeSet<Integer> set = new TreeSet<>(
                (o1, o2) -> {
                    int res = o1 - o2;
                    res = res == 0 ? 1 : res;
                    return res;
                }
        );
        int[] sum = new int[strings.length];
        for (int i = 0; i < strings.length; i++) {
            sum[i] = Integer.parseInt(strings[i]);
        }

        for (int i = 0; i < sum.length; i++) {
            set.add(sum[i]);
        }

        StringBuilder sb = new StringBuilder();
        for (Integer integer : set) {
            sb.append(" "+integer);
        }

        System.out.println(sb);




    }
}
